﻿using Hangfire.Dashboard;

namespace HungFire.Net5.Filter
{
    /// <summary>
    /// 权限过滤
    /// </summary>
    public class MyAuthorizationFilter : IDashboardAuthorizationFilter
    {
        public bool Authorize(DashboardContext context)
        {
            var httpContext = context.GetHttpContext();

            // Allow all authenticated users to see the Dashboard (potentially dangerous).
            return httpContext.User.Identity.IsAuthenticated;
        }
    }
}
